package controllers

import (
	"beego/models"
	"beego/redis"
	"encoding/json"
	"fmt"
	"github.com/astaxie/beego"
)

type NbaSchedulesController struct {
	beego.Controller
}

func (c *NbaSchedulesController) Get() {
	redis.Init()
	res, _ := redis.GetRedis("e")
	var rrr models.Schedules
	err := json.Unmarshal(res, &rrr)
	if err != nil {
		fmt.Println(err)
	}
	c.Data["json"] = &rrr
	c.ServeJSON()
}
